package com.bestdreamer.url;

import java.net.URLDecoder;
import java.net.URLEncoder;

public class URLDecoderTest {

    public static void main(String[] args) throws Exception{
        // 将 application/x-xxx-form-urlencoded 字符串转换成普通字符串
        String keyWork = URLDecoder.decode("%B7%E8%BF%F1java","GBK");
        System.out.println(keyWork);

        // application/x-xxx-form-urlencoded 字符串
        String urlStr = URLEncoder.encode("疯狂Java讲义","GBK");
        System.out.println(urlStr);
    }

}
